#!/usr/bin/env python
# -*- coding: utf-8 -*-
#License: GPL
#Copyright(C)Bill Lee
#Modified By(C) Finalx
#To veiw the weather of a different city, go to www.weather.com.cn to search your city. Then replace "101220501" below with the number in the URL of weather of your city.
import os
os.system(r"w3m -no-cookie -no-graph http://wap.weather.com.cn/wap/weather/101190101.shtml > /tmp/.weather.com.cn-data")
fin = open("/tmp/.weather.com.cn-data")
fin.readline()
fin.readline()
line = fin.readline()
location = line.strip()
fin.readline()
line = fin.readline()
issuetime = line[0:16]
line = fin.readline()
line = fin.readline()
date = line[0:12]
date = date.strip()
line = fin.readline()
line = fin.readline()
weather = line.strip()
line = fin.readline()
wind = line.strip()
print "${color0}${voffset -20}" + location +"${color} "
print "发布时间：${color0}" + issuetime + "${color}"
print date + "预报：${color2}" + weather + "  " + wind + "${color}"
